package com.yzs.core

import androidx.annotation.Keep
import com.alibaba.android.arouter.launcher.ARouter

/**
 * author : yzs
 * time   : 2021/06/29
 * desc   : ARouter path
 * 统一管理路由 URL 和 跳转调用
 */


fun get(): ARouter = ARouter.getInstance()

/**
 * 普通不带参数跳转
 */
private fun router(path: String) {
    get().build(path).navigation()
}

@Keep
interface ARouterUrl {
    @Keep
    class Demo { //  demo 模块
        companion object {
            const val URL_DEMO_FLOW = "/demo/ac/flow"
            const val URL_DEMO_DEMO = "/demo/ac/demo"
            const val URL_DEMO_DEMO_JAVA = "/demo/ac/demoJava"
        }
    }

    @Keep
    class Login { //  login 模块
        companion object {
        }
    }

    @Keep
    class User { //  user 模块
        companion object {
        }
    }
}


object Router {

    // region demo 模块 ------------------------------------------------------------
    fun startFlow() {
        get().build(ARouterUrl.Demo.URL_DEMO_FLOW).navigation()
    }

    fun startDemo() {
        get().build(ARouterUrl.Demo.URL_DEMO_DEMO).navigation()
    }

    fun startDemoJava() {
        get().build(ARouterUrl.Demo.URL_DEMO_DEMO_JAVA).navigation()
    }

    // endregion


    // region app 模块 ------------------------------------------------------------

    // endregion


    // region login 模块 ------------------------------------------------------------

    // endregion


    // region user 模块 ------------------------------------------------------------

    // endregion


    // region core 模块 ------------------------------------------------------------

    // endregion


}

